#ifndef GLOBAL_CONFIG_H
#define GLOBAL_CONFIG_H
#include <mutex>

#include <base_logger.h>
#include <QString>

#define DEAM_UI_LOG_MODULE   "deam_ui"
#define DEAM_UI_LOG_FILENAME "deam_ui.log"
#define SPDLOG_DEAM base_logger::getLogger(DEAM_UI_LOG_MODULE)

class global_config
{
public:
    // 获取单例实例
    static global_config& instance()
    {
        static std::once_flag flag;
        static global_config* inst = nullptr;
        std::call_once(flag, []() { inst = new global_config(); });
        return *inst;
    }

    void init_log_config(const QString& log_full_path);
private:
    global_config() = default;
    ~global_config() = default;
    global_config(const global_config&) = delete;
    global_config& operator=(const global_config&) = delete;
};

#endif // GLOBAL_CONFIG_H
